home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / shazam11.zip / ED.VIR < prev    next >
Text File  |  1991-11-04  |  2KB  |  62 lines

  1.    {===================================================================
  2.  
  3.    VARIABLES & OBJECTS
  4.  
  5.    ===================================================================}
  6. const
  7.    HeapSize                  = 32 * ( 1024 div 16 ) ;
  8. var
  9.    ClipWindow                : PEditWindow ;
  10.    {===================================================================
  11.  
  12.    Steal heap for editor
  13.  
  14.    ===================================================================}
  15. procedure TEDApp.PreInit ;
  16. var
  17.    H                         : word ;
  18. begin
  19.    H                         := PtrRec ( HeapEnd ).Seg -
  20.                                 PtrRec ( HeapPtr ).Seg ;
  21.    if H > HeapSize then
  22.       BufHeapSize            := H - HeapSize
  23.    else
  24.       BufHeapSize            := 0 ;
  25.    InitBuffers ;
  26. end ;
  27.  
  28. procedure TEDApp.PostInit ;
  29. begin
  30.    DisableCommands ( [ cmSave,
  31.                        cmSaveAs,
  32.                        cmCut,
  33.                        cmCopy,
  34.                        cmPaste,
  35.                        cmClear,
  36.                        cmUndo,
  37.                        cmFind,
  38.                        cmReplace,
  39.                        cmSearchAgain ] ) ;
  40.    EditorDialog              := DoEditDialog ;
  41.    ClipWindow                := OpenEditor ( '' , FALSE ) ;
  42.    if ClipWindow <> NIL then
  43.    begin
  44.       Clipboard              := ClipWindow^.Editor ;
  45.       Clipboard^.CanUndo     := FALSE ;
  46.    end ;
  47.    if ParamCount = 0 then EXIT ;                        { no filespec }
  48.    if ( Pos ( '*' , ParamStr ( 1 ) ) = 0 ) and
  49.       ( Pos ( '?' , ParamStr ( 1 ) ) = 0 ) then
  50.       OpenEditor ( ParamStr ( 1 ) , TRUE ) ;           { no wildcards }
  51. end ;
  52.    {===================================================================
  53.  
  54.    DONE
  55.  
  56.    ===================================================================}
  57. procedure TEDApp.PostDone ;
  58. begin
  59.    DoneBuffers ;
  60.    writeln ( 'SYNTAX:  C:>program filename' ) ;
  61. end ;
  62.